<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: AnsiTerminal</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 VGA Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_ansi_terminal-example.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">AnsiTerminal</div>  </div>
</div><!--header-->
<div class="contents">
<p>allll</p>
<p>VGA output can be configured such as 8 colors or 64 colors are displayed. Eight colors require 5 outputs (R, G, B, H and V), while sixty-four colors require 8 outputs (R0, R1, G0, G1, B0, B1, H and V).</p>
<p>Following an example of outputs configuration and a simple digital to analog converter circuit:</p>
<pre class="fragment">  === 8 colors, 1 bit per channel, 3 bit per pixel ===

  Sample connection scheme:
                       -----------
   GPIO22 (red0) ------|R 270 Ohm|---- VGA_R
                       -----------

                       -----------
   GPIO21 (green0) ----|R 270 Ohm|---- VGA_G
                       -----------

                       -----------
   GPIO19 (blue0) -----|R 270 Ohm|---- VGA_B
                       -----------

   GPIO18 ---------------------------- VGA_HSYNC

   GPIO5  ---------------------------- VGA_VSYNC

  Using above GPIOs the VGA Controller may be initialized in this way:
    VGAController.begin(GPIO_NUM_22, GPIO_NUM_21, GPIO_NUM_19, GPIO_NUM_18, GPIO_NUM_5);

  === 64 colors, 2 bit per channel, 6 bit per pixel ===

       One resistor for each R0, R1, G0, G1, B0 and B1. Low bit (LSB) should have
       twice resistance value than high bit (MSB), for example 800Ohm (LSB) and 400Ohm (MSB).

                       ------------
   GPIO22 (red1) ------|R 400 Ohm |------*---- VGA_R
                       ------------      |
                       ------------      |
   GPIO21 (red0) ------|R 800 Ohm |------*
                       ------------

                       ------------
   GPIO19 (green1) ----|R 400 Ohm |------*---- VGA_G
                       ------------      |
                       ------------      |
   GPIO18 (green0) ----|R 800 Ohm |------*
                       ------------

                       ------------
   GPIO5 (blue1) ------|R 400 Ohm |------*---- VGA_B
                       ------------      |
                       ------------      |
   GPIO4 (blue0) ------|R 800 Ohm |------*
                       ------------

   GPIO23 ------------------------------------ VGA_HSYNC

   GPIO15 ------------------------------------ VGA_VSYNC

  Using above GPIOs the VGA Controller may be initialized in this way:
    VGAController.begin(GPIO_NUM_22, GPIO_NUM_21, GPIO_NUM_19, GPIO_NUM_18, GPIO_NUM_5, GPIO_NUM_4, GPIO_NUM_23, GPIO_NUM_15);

Note: Do not connect GPIO_NUM_2 (led) to the VGA signals.
</pre><p>PS2 Keyboard connection uses two GPIOs (data and clock) and requires one 120 Ohm series resistor and one 2K Ohm pullup resistor for each signal: </p><pre class="fragment">                                        +5V
                                         |
                                         |
                                         *-----+
                                         |     |
                                        ---   ---
                                        | |   | |
                                        |R|   |R|
                                        |2|   |2|
                                        |K|   |K|
                                        | |   | |
                                        ---   ---
                       ------------      |     |
   GPIO33 (CLK)    ----|R 120 Ohm |------*--------- PS/2 KEYBOARD CLK
                       ------------            |
                       ------------            |
   GPIO32 (DAT)    ----|R 120 Ohm |------------*--- PS/2 KEYBOARD DAT
                       ------------

  Using above GPIOs the PS2 Keyboard Controller may be initialized in this way:
    Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32);  // clk, dat
</pre><dl class="section author"><dt>Author</dt><dd>Fabrizio Di Vittorio (<a href="#" onclick="location.href='mai'+'lto:'+'fdi'+'vi'+'tto'+'20'+'13@'+'gm'+'ail'+'.c'+'om'; return false;">fdivi<span style="display: none;">.nosp@m.</span>tto2<span style="display: none;">.nosp@m.</span>013@g<span style="display: none;">.nosp@m.</span>mail<span style="display: none;">.nosp@m.</span>.com</a>) </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) 2018 Fabrizio Di Vittorio. All rights reserved. - GNU General Public License</dd></dl>
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
